Skip to content

[MLI-7222] test(api): parametrize cloud backend selection by cloud_provider#844

Merged
lorenzo-norcini-scale merged 2 commits into
mainfrom
lorenzonorcini/mli-7222-parametrized-test-cloud-backend-selection-by-cloud_provider
Jun 23, 2026
Merged

[MLI-7222] test(api): parametrize cloud backend selection by cloud_provider#844
lorenzo-norcini-scale merged 2 commits into
mainfrom
lorenzonorcini/mli-7222-parametrized-test-cloud-backend-selection-by-cloud_provider

Conversation

@lorenzo-norcini-scale

@lorenzo-norcini-scale lorenzo-norcini-scale commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Parametrized unit test pinning the concrete backend class selected for each cloud_provider (aws/azure/gcp/onprem) in the API dependency wiring. Replaces the single-provider test_gcp_provider_selects_gcp_implementations.

Test-only change.

Resolves MLI-7222.

🤖 Generated with Claude Code

Greptile Summary

This PR replaces the single-provider test_gcp_provider_selects_gcp_implementations test with a parametrized test_cloud_provider_selects_expected_backends that covers all four cloud backends (aws, azure, gcp, onprem) in one sweep. It also widens the assertion surface to include llm_fine_tune_repository and inference_autoscaling_metrics_gateway, both of which were unverified before.

  • Parametrization: _PROVIDER_CASES drives four pytest.param entries; each pins the full set of concrete backend classes selected by _get_external_interfaces for that cloud_provider.
  • Broader assertions: The new test adds isinstance checks for llm_fine_tuning_service.llm_fine_tune_repository and resource_gateway.inference_autoscaling_metrics_gateway that were absent from the previous GCP-only test.
  • Dropped unnecessary mock: The old test patched ASBInferenceAutoscalingMetricsGateway even for GCP (where it is never instantiated). The new test omits that patch; for the azure case it correctly lets the real (no-__init__) class instantiate so that the isinstance assertion is meaningful.

Confidence Score: 5/5

Test-only change; no production code is modified and the new parametrized test correctly mirrors the wiring logic in dependencies.py for all four cloud backends.

Every expected class was cross-checked against the actual branch conditions in _get_external_interfaces. The docker registry inference (infer_registry_type) correctly maps the chosen prefixes to ecr/acr/gar, and the onprem case explicitly sets docker_registry_type to bypass prefix inference. Azure-specific classes (ABSFilesystemGateway, ASBInferenceAutoscalingMetricsGateway) have no init that touches Azure SDKs, so dropping the ASBInferenceAutoscalingMetricsGateway mock is safe and makes the isinstance assertion meaningful. No logic gaps were found.

No files require special attention.

Important Files Changed

Filename Overview
model-engine/tests/unit/api/test_dependencies.py Replaces the single-provider GCP test with a 4-provider parametrized test; imports, fixture data, and assertions all align correctly with the actual wiring logic in dependencies.py.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    CP[cloud_provider] --> AWS[aws]
    CP --> AZURE[azure]
    CP --> GCP[gcp]
    CP --> ONPREM[onprem]

    AWS --> AWS_Q[SQSQueueEndpointResourceDelegate]
    AWS --> AWS_FS[S3FilesystemGateway]
    AWS --> AWS_ART[S3LLMArtifactGateway]
    AWS --> AWS_FILE[S3FileStorageGateway]
    AWS --> AWS_DOCKER[ECRDockerRepository]
    AWS --> AWS_FT[S3FileLLMFineTuneRepository]
    AWS --> AWS_METRICS[RedisInferenceAutoscalingMetricsGateway]

    AZURE --> AZ_Q[ASBQueueEndpointResourceDelegate]
    AZURE --> AZ_FS[ABSFilesystemGateway]
    AZURE --> AZ_ART[ABSLLMArtifactGateway]
    AZURE --> AZ_FILE[ABSFileStorageGateway]
    AZURE --> AZ_DOCKER[ACRDockerRepository]
    AZURE --> AZ_FT[ABSFileLLMFineTuneRepository]
    AZURE --> AZ_METRICS[ASBInferenceAutoscalingMetricsGateway]

    GCP --> GCP_Q[GcpPubSubQueueEndpointResourceDelegate]
    GCP --> GCP_FS[GCSFilesystemGateway]
    GCP --> GCP_ART[GCSLLMArtifactGateway]
    GCP --> GCP_FILE[GCSFileStorageGateway]
    GCP --> GCP_DOCKER[GARDockerRepository]
    GCP --> GCP_FT[GCSFileLLMFineTuneRepository]
    GCP --> GCP_METRICS[RedisInferenceAutoscalingMetricsGateway]

    ONPREM --> OP_Q[OnPremQueueEndpointResourceDelegate]
    ONPREM --> OP_FS[S3FilesystemGateway]
    ONPREM --> OP_ART[S3LLMArtifactGateway]
    ONPREM --> OP_FILE[S3FileStorageGateway]
    ONPREM --> OP_DOCKER[OnPremDockerRepository]
    ONPREM --> OP_FT[S3FileLLMFineTuneRepository]
    ONPREM --> OP_METRICS[RedisInferenceAutoscalingMetricsGateway]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    CP[cloud_provider] --> AWS[aws]
    CP --> AZURE[azure]
    CP --> GCP[gcp]
    CP --> ONPREM[onprem]

    AWS --> AWS_Q[SQSQueueEndpointResourceDelegate]
    AWS --> AWS_FS[S3FilesystemGateway]
    AWS --> AWS_ART[S3LLMArtifactGateway]
    AWS --> AWS_FILE[S3FileStorageGateway]
    AWS --> AWS_DOCKER[ECRDockerRepository]
    AWS --> AWS_FT[S3FileLLMFineTuneRepository]
    AWS --> AWS_METRICS[RedisInferenceAutoscalingMetricsGateway]

    AZURE --> AZ_Q[ASBQueueEndpointResourceDelegate]
    AZURE --> AZ_FS[ABSFilesystemGateway]
    AZURE --> AZ_ART[ABSLLMArtifactGateway]
    AZURE --> AZ_FILE[ABSFileStorageGateway]
    AZURE --> AZ_DOCKER[ACRDockerRepository]
    AZURE --> AZ_FT[ABSFileLLMFineTuneRepository]
    AZURE --> AZ_METRICS[ASBInferenceAutoscalingMetricsGateway]

    GCP --> GCP_Q[GcpPubSubQueueEndpointResourceDelegate]
    GCP --> GCP_FS[GCSFilesystemGateway]
    GCP --> GCP_ART[GCSLLMArtifactGateway]
    GCP --> GCP_FILE[GCSFileStorageGateway]
    GCP --> GCP_DOCKER[GARDockerRepository]
    GCP --> GCP_FT[GCSFileLLMFineTuneRepository]
    GCP --> GCP_METRICS[RedisInferenceAutoscalingMetricsGateway]

    ONPREM --> OP_Q[OnPremQueueEndpointResourceDelegate]
    ONPREM --> OP_FS[S3FilesystemGateway]
    ONPREM --> OP_ART[S3LLMArtifactGateway]
    ONPREM --> OP_FILE[S3FileStorageGateway]
    ONPREM --> OP_DOCKER[OnPremDockerRepository]
    ONPREM --> OP_FT[S3FileLLMFineTuneRepository]
    ONPREM --> OP_METRICS[RedisInferenceAutoscalingMetricsGateway]
Loading

Reviews (1): Last reviewed commit: "Merge branch 'main' into lorenzonorcini/..." | Re-trigger Greptile

lorenzo-norcini-scale and others added 2 commits June 20, 2026 19:27
…-7222)

Add a parametrized test pinning the concrete backend class selected for each
cloud_provider (aws/azure/gcp/onprem) across queue delegate, filesystem,
artifact, file-storage, docker repository, fine-tune repo + events repo, and
autoscaling-metrics gateway. Subsumes and replaces the single-provider
test_gcp_provider_selects_gcp_implementations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lorenzo-norcini-scale lorenzo-norcini-scale marked this pull request as ready for review June 23, 2026 18:46
@lorenzo-norcini-scale lorenzo-norcini-scale changed the title [DO NOT MERGE][MLI-7222] test(api): parametrize cloud backend selection by cloud_provider [MLI-7222] test(api): parametrize cloud backend selection by cloud_provider Jun 23, 2026

@billyang-scale billyang-scale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

congrats to your first PR!

@lorenzo-norcini-scale lorenzo-norcini-scale merged commit 1bdf8a6 into main Jun 23, 2026
7 of 8 checks passed
@lorenzo-norcini-scale lorenzo-norcini-scale deleted the lorenzonorcini/mli-7222-parametrized-test-cloud-backend-selection-by-cloud_provider branch June 23, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants